<%@ page language="java" import="java.util.*,com.ccl.impl.*,com.ccl.model.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'detailNews.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style>
body{
	 margin:0;
	}
   .div1{
	background: #000;
	color: #FFF;
	width: 100%;
	height: 80px;
	display: table-cell;
	text-align: center;
	vertical-align: middle;
	float: left;
	   }
	.div2{
		background: #000;
	  color: #FFF;
		}
		 .div3{
	background: #000;
	color: #FFF;
	width: 100%;
	height: 60px;
	display: table-cell;
	text-align: center;
	vertical-align: middle;
	float: left;
	   }
	   
	   .div4{	
	   display:table;	   
		    margin:100px auto 0 auto;
			}
			td{
			color:#FFF;
			text-align: center;
		}
		form{
		color:#FFF;
			text-align: center;
		}
		td a{
		   color: #FFF;
		}
</style>
  </head>
<%    String username = (String)session.getAttribute("username1");
      String password = (String)session.getAttribute("password1");
      if(username == null){
            session.setAttribute("kk", "请先登入");
      response.sendRedirect("index.jsp");
      } %>  
  <body>
   <div style="background-color:#000000; height: 100%">
  
  <div class="div1">
  <h1 style="size:20px">新闻发布管理</h1>
</div>
<div class="div2">
<table width="100%" border="2" style="text-align:center; font-family:'微软雅黑';">
  <tr>
     <td width="16%"> <a href="#">首页</a></td>
    <td  width="16%"><a href="login.jsp">登录页面</a></td>

    <td  width="16%"><a href="addAdmin.jsp">增加Admin</a></td>
    <td  width="16%"><a href="userModify.jsp">更改信息</a></td>
    <td  width="16%"><a href="addNews.jsp">新闻发布</a></td>
    <td  width="16%"><a href="listNews.jsp">News详情</a></td>

  </tr>
</table>

</div>

<div class="div3">
     <table width="100%" border="2">
  <tr>
    <td><h3>了解详情</h3></td>
  </tr>
</table>
</div>
 <%
       NewsDayimpl dao = new NewsDayimpl();
		List<NewsDay> list = dao.queryNewss();
   %>
   <%for(NewsDay p:list){ %>
   <%if(request.getParameter("number").equals(p.getNumber()+"")){ %>
<div class="div4" >
 <form action="updateNewssServel" method="post">
       <input type="hidden" name="number" value="<%=request.getParameter("number")%>">
               标题:<input type="text" size="116" style="text-align:center; height:25px;" name="title" id="title" value="<%=p.getTitle()%>"/>
        <br /><br /><br />
              内容:<textarea rows="15" cols="100" name="content" id="content"><%=p.getContent()%></textarea><br>
      </form>   
</div>   
      <%} }
      %>
      </div>
  </body>
</html>
